<template>
  <div class="patient-detail">
    <div class="patient-info flex-box-align">
      <img :src="avatar" alt="" class="avatar">
      <span class="flex">{{name}}</span>
      <div class="icon-patient-record" @click="linkToRecordList(id)">
        <img src="../../images/patientRecord.png" alt="">
      </div>
    </div>
  </div>
</template>
<script>
  import {parseUrlParams} from "../../../wechat/static/util/util.js";
  import common from "../../../wechat/static/common/common"
  common.setPageTitle("患者姓名")

  export default {
    data() {
      return {
        id: "",
        name: "",
        avatar: ""
      }
    },
    components: {

    },
    mounted() {
      this.id = parseUrlParams("id")
      this.name = decodeURIComponent(parseUrlParams("name"))
      this.avatar = decodeURIComponent(parseUrlParams("avatar"))

      console.log(this.name)
    },
    methods: {
      linkToRecordList(id) {
        this.$router.push({path: "/patient/record/list", query: {id: id}})
      }
    }
  };
</script>
<style lang="less">
  .patient-detail {
    height: 100%;
    background-color: #f4f4f4;
    font-size: .34rem;
    .patient-info {
      background-color: #fff;
      padding: .17rem .61rem .17rem .3rem;
      .avatar {
        width: .76rem;
        height: .76rem;
        vertical-align: middle;
        margin-right: .28rem;
      }
      .icon-patient-record {
        width: .57rem;
        img {
          width: 100%;
          height: 100%;
          vertical-align: middle;
        }
      }
    }
  }
</style>
